package com.example.agriculture.util;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new
                        LoginInterceptor()).addPathPatterns("/**")
                .excludePathPatterns("/admin", "/","/User/loginUser","/main","/reg","/reg_main","/User/mushrooms",
                        "/User/userforgetpassword"
                        ,"/User/loginGet","/User/register","/User/registeruser","/BMS/**","/validCode/code",
                        "/css/**","/images/**","/img/**","/js/**",
                        "/User/css/**","/User/images/**","/User/img/**","/User/js/**","/User/Uforget");
    }

}

